import {createSlice} from "@reduxjs/toolkit";
 
const initialState={
  primary:'#4060c7', // 主题色
  tabColor:'#fff' ,//导航栏颜色
  menuColor:true ,//侧边栏颜色
  istags:true ,//是否显示标签
}

const themSlice = createSlice({
  name: "themeSlice",
  // `createSlice` 将从 `initialState` 参数推断 state 类型
  initialState,
  reducers: {
    changeTheme(state,{type,payload}){
      state.primary = payload
      // console.log('主题颜色',state.primary,payload);
    },
    changeTagColor(state,{type,payload}){
      state.tabColor = payload
      console.log('导航栏颜色',payload);
    },
    changeMenuColor(state,{type,payload}){
      state.menuColor = payload
      // console.log('侧边栏颜色',payload);
    },
    changeTags(state,{type,payload}){
      state.istags = payload
      console.log('是否显示标签',payload);
      // console.log('是否显示标签');
    }
  }
})
export const {changeTheme,changeTagColor,changeMenuColor,changeTags} = themSlice.actions;
export default themSlice.reducer;
